import { objectToYaml } from "./object";
import FileSaver from "file-saver";

export const saveYamlAsFile = async (yaml: any, filename: string) => {
  const yamlContent = objectToYaml(yaml);
  const blob = new Blob([yamlContent], { type: "text/yaml;charset=utf-8" });
  FileSaver.saveAs(blob, filename);
};
